﻿#pragma once
#include <stdint.h>
#include <string>
#include "enum_define.h"

#pragma pack(push, 2)
struct MinuteBar {
	uint16_t min;
	uint32_t open;
	uint32_t high;
	uint32_t low;
	uint32_t close;
	uint32_t volume;
	float amount;

};
#pragma pack(pop)




#pragma pack(push, 4)
struct Bar {
	uint32_t time;
	uint32_t open;
	uint32_t high;
	uint32_t low;
	uint32_t close;
	uint64_t volume;
	float amount;
	bool operator<(const struct Bar & v)const{
		return time<v.time;
	}
};
#pragma pack(pop)


struct BarSeries {
	BarSeries(Bar* v1 = nullptr, int32_t v2 = 0):ptr(v1),count(v2) {};
	Bar* ptr;
	//BarSize barsize;
	//BarDateTime startTime;//第一个bar的时间
	int32_t count;//倒序
	bool valid() { return ptr != nullptr; }
};

struct BarSeriesReq {
	
	std::string symbol;
	uint8_t exchange_id;
	uint8_t barsize;
	int16_t lastindex;
	int16_t count;
};
